home *** CD-ROM | disk | FTP | other *** search
- //***********************************************************************
- //
- // MainFrame.cpp
- //
- //***********************************************************************
-
- #include <afxwin.h>
- #include <afxext.h>
- #include <afxcview.h>
- #include "Resource.h"
- #include "MainFrame.h"
- #include "WandDoc.h"
- #include "DriveView.h"
- #include "FileView.h"
-
- IMPLEMENT_DYNCREATE (CMainFrame, CFrameWnd)
-
- BEGIN_MESSAGE_MAP (CMainFrame, CFrameWnd)
- ON_WM_CREATE ()
- END_MESSAGE_MAP ()
-
- BOOL CMainFrame::PreCreateWindow (CREATESTRUCT& cs)
- {
- if (!CFrameWnd::PreCreateWindow (cs))
- return FALSE;
-
- cs.style &= ~FWS_ADDTOTITLE;
- return TRUE;
- }
-
- int CMainFrame::OnCreate (LPCREATESTRUCT lpcs)
- {
- if (CFrameWnd::OnCreate (lpcs) == -1)
- return -1;
-
- m_wndStatusBar.Create (this);
- UINT nIndicator = ID_SEPARATOR;
- m_wndStatusBar.SetIndicators (&nIndicator, 1);
- return 0;
- }
-
- BOOL CMainFrame::OnCreateClient (LPCREATESTRUCT lpcs,
- CCreateContext* pContext)
- {
- if (!m_wndSplitter.CreateStatic (this, 1, 2) ||
- !m_wndSplitter.CreateView (0, 1, RUNTIME_CLASS (CFileView),
- CSize (0, 0), pContext) ||
- !m_wndSplitter.CreateView (0, 0, RUNTIME_CLASS (CDriveView),
- CSize (192, 0), pContext))
- return FALSE;
-
- return TRUE;
- }
-
- BOOL CMainFrame::OnCmdMsg (UINT nID, int nCode, void* pExtra,
- AFX_CMDHANDLERINFO* pHandlerInfo)
- {
- // Route to standard command targets first
- if (CFrameWnd::OnCmdMsg (nID, nCode, pExtra, pHandlerInfo))
- return TRUE;
-
- // Route to inactive views second
- CWandDoc* pDoc = (CWandDoc*) GetActiveDocument ();
- if (pDoc != NULL) {
- if (pDoc->RouteCmdToAllViews (GetActiveView (), nID, nCode,
- pExtra, pHandlerInfo))
- return TRUE;
- }
-
- return FALSE;
- }
-